/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.purchasetickets;

import assignment_cp3120.DAO.Factory.DAOFactory;
import assignment_cp3120.dataObjects.Ticket;
import assignment_cp3120.dataObjects.Flight;
import java.util.Vector;
import java.sql.Date;
/**
 *
 * @author jc148311
 */
public class PurchaseTicketsModel {
    private Vector <Ticket> tickets;
    private Vector <Flight> flights;

    public PurchaseTicketsModel() {
        tickets = DAOFactory.getDAOFactory().getTicketDAO().getTicketList();
        flights = DAOFactory.getDAOFactory().getFlightDAO().getFlightsFromDate(new Date(System.currentTimeMillis()));
    }

    public Vector getTicketList() {
        return tickets;
    }

    public Vector getFlightList() {
        return flights;
    }

    public void updateTicketDB(Ticket ticket) {
        DAOFactory.getDAOFactory().getTicketDAO().updateTickets(ticket);
    }
}
